import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/views/Main.vue'
import Login from '@/views/login/index.vue'
import Admin from '@/views/auth/admin/index.vue'
import User from '@/views/auth/user/index.vue'
import Data from '@/views/vppz/data/index.vue'
import Boat from '@/views/vppz/boat/index.vue'
import Dashboard from '@/views/dashboard/index.vue'

const routes = [{
    path: '/',
    component: Layout,
    name: 'main',
    children: [
        {
            path: 'dashboard',
            meta: { id: '1', name: '控制台', icon: 'Platform', path: '/dashboard', describe: '用于展示当前系统中的统计数据、统计报表及重要实时数据,小敏敏最棒' },
            component: Dashboard
        },
        {
            path: 'vppz',
            meta: { id: '3', name: '无人船数据管理', icon: 'Ship' },
            children: [
            {
                path: 'boat',
                meta: { id: '2', name: '无人船管理', icon: 'List', path: '/vppz/boat', describe: '展示无人船的各项信息' },
                component: Boat
            },
            {
                path: '',
                alias: ['data'],
                meta: { id: '1', name: '水质数据管理', icon: 'Histogram', path: '/vppz/data', describe: '无人船水质监测数据展示，可查看实时数据和历史数据' },
                component: Data
            }
            ]
        },
        {
            path: 'auth',
            meta: { id: '2' ,name: '用户管理', icon: 'Grid' },
            children: [
            {
                path: '',
                alias: ['admin'],
                meta: { id: '1', name: '权限管理', icon: 'Menu', path: '/auth/admin', describe: '管理员可以进行用户管理，编辑用户权限或者删除用户' },
                component: Admin
            },
            {
                path: 'user',
                meta: { id: '2', name: '个人用户', icon: 'Avatar', path: '/auth/user', describe: '用户可以进行个人信息的修改' },
                component: User
            }
            ]
        }
    ]
    },
    {
        path: '/user/login',
        component: Login
    },
]


const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router